<?php
// application/layouts/scripts/layout.phtml

echo $this->doctype() ?>
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head>  
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
  <title>Genesis</title>
  <link rel="stylesheet" type="text/css" href="/css/global.css"/>
  <link rel="stylesheet" type="text/css" href="/js/jqueryui/css/<?=$this->jqueryuiTheme?>/jquery-ui-1.7.2.custom.css"/>
  <link rel="stylesheet" type="text/css" href="/js/jquery/multi-ddm/styles.css"/>
  <script type="text/javascript" src="/js/jquery/jquery-1.3.2.js"></script>
  <script type="text/javascript" src="/js/jqueryui/js/jquery-ui-1.7.2.custom.min.js"></script>
  <script type="text/javascript" src="/js/jquery/multi-ddm/jquery.multi-ddm.js"></script>
  <?=$this->headScript()?>
  <?=$this->headLink()?>
<script type="text/javascript">

    function focusUsername() {
        if ($('#username').css('color') == 'gray') {
            $('#username').attr('value','');
            $('#username').css('color','black');
        } 
    }

    function blurUsername() {
        if (jQuery.trim($('#username').attr('value')) == '') {
            $('#username').css('color','gray');
            $('#username').attr('value','username');
        }
    }

    function focusPassword2() {

        $('#password2').css('display','none');
        $('#password').css('display','');
        $('#password').focus();

    }

    function blurPassword() {
        if ($('#password').attr('value') == '') {
            
            $('#password').css('display','none');
            $('#password2').css('display','');
            $('#password2').focus();

        }
    }

    $(function(){
        var css = ['parent-hover','child-hover1', 'child-hover2'];
        $('.menu').attr('id', "multi-ddm");
        $('.menu').dropDownMenu({timer: 800, levels: css});

    });

   

</script>

</head> 
<body>
    <img src='/images/toplogo/title.jpg'/>
<div id="header" style="height: 24px;margin-bottom:5px;">
    <div id="header-navigation" style="position:absolute;z-index:200;top:20px;left:300px;width:<? if ($this->loginForm): ?>560px<?else:?>auto<?endif?>">
        <?=$this->navigation()->menu()->setUlClass('menu') ?>
        <? if ($this->loginForm): ?>
        <form id="<?=$this->loginForm->getId()?>" action="<?=$this->loginForm->getAction()?>" method="<?=$this->loginForm->getMethod()?>" name="<?=$this->loginForm->getName()?>" enctype="<?=$this->loginForm->getEnctype()?>" style="float:right;padding-left:15px; padding-right:5px">
            <input type="text" id="username" name="username" value="username" style="color:gray;width:90px" onfocus="focusUsername()" onblur="blurUsername()"/>&nbsp;
            <input type="text" id="password2" name="password2" value="password" style="color:gray;width:90px" onfocus="focusPassword2()"/>
            <input type="password" id="password" name="password" value="" style="width:90px;display:none" onblur="blurPassword()"/>
            <input id="loginButton" class="navbutton" type="submit" value="Login"/>
            <input class="navbutton" type="button" id="registerButton" onclick="window.location='/user/register'" value="Register"/>
        </form>
        <? endif; ?>
    </div>
</div>

    <div id ="mainContent">
<div id="messages">
<? if (sizeof($this->messages)>0):?>
    <ul style="list-style-type:none">
        <?foreach ($this->messages as $message):?>
        <li class="messageSuccess<?=$message['success']?>"><input type="button" value="X" onclick="this.parentNode.parentNode.removeChild(this.parentNode)"/>&nbsp;<?=$message['message']?></li>
        <?endforeach;?>
    </ul>
<? endif; ?>
</div>
        <div id="page_content">
<?php echo $this->layout()->content ?>
        </div>
    </div>
</body>
</html>
